#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
int n, m; int xx, yy, x2, y2;
int arr[1005][1005];
int main()
{
	cin >> n >> m;
	while (m--) {
		scanf("%d%d%d%d", &xx, &yy, &x2, &y2);
		for (int i = xx; i <= x2; i++) {
			arr[i][yy] += 1;
			arr[i][y2 + 1] -= 1;
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			arr[i][j] += arr[i][j - 1];
			printf("%d ", arr[i][j]);
		}
		printf("\n");
	}
	return 0;
}